package judesart.app.client.controller;

import java.util.List;

import judesart.app.domain.Note;
import judesart.app.domain.Project;
import judesart.app.shared.ArtworkShort;
import judesart.app.shared.SearchResult;
import judesart.app.shared.ValidationException;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("project")
public interface ProjectController extends RemoteService
{
    public static class Util
    {
        private static ProjectControllerAsync instance;

        public static ProjectControllerAsync getInstance()
        {
            if (instance == null)
            {
                instance = GWT.create(ProjectController.class);
            }
            return instance;
        }
    }

    Project createProject(Project project) throws ValidationException;

    Project updateProject(Project project) throws ValidationException;

    void deleteProject(Long projectId);

    SearchResult<Project> searchProjects(int startAt, int maxElements);

    Project getProject(Long id);

    void deleteSketchFromProject(Long projectId, Long imageId);

    String findSketchKeyByImageId(Long imageId);

    String updateSketchDescription(String sketchKey, String description);

    void deletePhotoFromProject(Long projectId, Long imageId);

    String findPhotoKeyByImageId(Long imageId);

    String updatePhotoDescription(String photoKey, String description);

    void addArtworkToProject(Long projectId, Long artworkId);

    void deleteArtworkFromProject(Long projectId, Long artworkId);

    List<ArtworkShort> findProjectArtworksImages(Long projectId);

    Note addNoteToProject(Long projectId, String text);

    void deleteNoteFromProject(Long projectId, String notekey);

    void updateNoteInProject(Note note);

    List<Project> findAllUserProjects(Long userId);

}
